<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        function uploadFile() {
            var upload = document.getElementById('uploadBtn');
            //Make sure choose a file
            if (upload.files.length) return true;
            return false;
        }


    </script>
    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script>
        // function uploadFile() {
        //     var upload = document.getElementById('uploadBtn');
        //     //Make sure choose a file
        //     if (upload.files.length) return true;
        // //     return false;
        // // }
        // var formData = new FormData(document.getElementById("form1"));//表单id
        // $.ajax({
        //     url: '/upload/img',
        //     type: 'POST',
        //     data: formData,
        //     async: false,
        //     cache: false,
        //     contentType: false,
        //     processData: false,
        //     success: function (result) {
        //         // console.log(result);

        //     }
        // });
    </script>
</head>

<body>
    <form id="uploadgame" onsubmit="return uploadFile()">
        游戏名字:
        <input type="text"  name="game_name" placeholder="请输入游戏的名字">
        <br> 英文名字:
        <input type="text" name="en_name" placeholder="请输入游戏的名字">
        <br> 游戏的类型:
        <input type="text" name="game_type" placeholder="请输入游戏的类型">
        <br> 游戏的url:
        <input type="text" name="game_url" placeholder="请输入游戏的url">
        <br> 游戏的描述:
        <input type="text" name="game_describe"placeholder="请输入游戏的名游戏的描述">
        <br> 游戏的口号:
        <input type="text" name="slogan"placeholder="请输入游戏的口号">
        <br> 游戏的是否公测:
        <input type="text"  name="operating_state" placeholder="请输入游戏的运营状态">
        <br> 游戏的公测时间:
        <input type="text" name = "star_date" placeholder="请输入游戏公测的时间">
        <br>推荐游戏图
        <input class="hotgame" name ="game_img1" type="text" placeholder="">
        <br>热门游戏图
        <input type="text" name ="game_img2" placeholder="">
        <br>最新游戏图
        <input type="text" name ="game_img3" placeholder="">
        <br>最小游戏图
        <input type="text" name ="game_img4" placeholder="">
        <br>
        <br>
        <br>
        <br>
        <button ="uploadgame" >提交游戏</button>
    </form>ß

    以下是图片上传的类型：
    <br>
    <br>
    
    <!-- enctype="multipart/form-data" 多功能媒体类型 图片 音乐 flash等-->
	<!-- enctype="application/x-www-form-urlencoded" 这个是默认值 -->
	<!-- enctype="text/plain" 这个是邮件专用 -->
	<form action="/upload/img" onsubmit="return uploadFile()" enctype="multipart/form-data" method="post">
        <div class="uploadBox">
            <a class="upload" href="javascript:void(0)">
            	选择图片
            	<input class="uploadBtn" id="uploadBtn" type="file" name="uploadBtn"/>
            </a>
            <input class="uploadToServer" name="uploadToServer" id="uploadToServer" type="submit" value="上传">
            <!-- <a class="uploadToServer" id="uploadToServer" href="javascript:void(0)">上传</a> -->
        </div>
    </form>

    <div id="img"></div>

    <script>
        function uploadFile() {
            var upload = document.getElementById('uploadBtn');
            //Make sure choose a file
            if(upload.files.length) return true;
            return false;
        }
        $(function () {
            $("uploadgame").click(function(params) {
                console.log(eeeeeeeee);
                // return false;ßß
            })
            // var str=("#uploadgame").serialize();
            // console.log(str);
            
            
        })
    </script>
</body>

</html>